/// 患者模型
class Patient {
  String id;
  String avatar;
  String patiAccountId;
  String fullname;
  String sex;
  int age;
  String cellphone;
  String idcard;
  String maritalTypeValue;
  String nativePlace;
  String email;
  String address;

  Patient({
    this.id,
    this.avatar,
    this.patiAccountId,
    this.fullname,
    this.sex,
    this.age,
    this.cellphone,
    this.idcard,
    this.maritalTypeValue,
    this.nativePlace,
    this.email,
    this.address,
  });

  factory Patient.fromJson(Map<String, dynamic> data) {
    return Patient(
      id: data['id'],
      avatar: data['avatar'],
      patiAccountId: data['patiAccountId'],
      fullname: data['fullname'],
      sex: data['sex'],
      age: data['age'] == '' ? 0 : data['age'],
      cellphone: data['cellphone'],
      idcard: data['idcard'],
      nativePlace: data['nativePlace'],
      maritalTypeValue: data['maritalTypeValue'],
      email: data['email'],
      address: data['address'],
    );
  }
}
